<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
            <title></title>
            <meta name="keywords" content="">
            <meta name="description" content="">
                    <link href="style.css" rel="stylesheet" type="text/css" media="screen">
                    <link type="text/css" rel="stylesheet" href="tsc_pagination.css">
    </head>
            <body>
                <?php require_once './header.php'; ?>
                <hr>
                    <div id="page">               
<?php
require_once './database/connection.php';
require_once './database/search.php';
$obj = new search_data();
?>
<div id="content">
    <form method="post" action="index_search.php">
   <input type="text" name="timkiem">
    <input type="submit" name="ok" value="Tim Kiem">
    </form>
    <?php
    if (isset($_POST['ok'])){
        $data = $obj->timkiem($_POST['timkiem']);
        foreach ($data as $dulieu){
        echo '<div class="post"><h1 class="title"><a href="index.php?view='.$dulieu['id'].'">'.$dulieu['title'].'</a></h1><p class="meta"><small>'.date('d-m-y') . ' '.'<a href="#">DuyHoa</a></small></p><div class="entry"><p>'.$dulieu['overview'].'</p></div>';
        }
        if(empty($data)){
            echo 'khong co bai viet';
        }
    }
    ?>
        </div>
                    </div>
            </body>
</html>